<?php

require_once '../data/ConfigClement.php';

$serveur = ConfigClement::$serveur;
$nom_base = ConfigClement::$nom_base;
$loginBd = ConfigClement::$loginBd;
$motdepasse = ConfigClement::$motdepasse;


$con = mysql_connect ($serveur,$loginBd,$motdepasse);

if ($con) {

	mysql_select_db($nom_base)or die ('ERREUR '.mysql_error());

	$requete = "DELETE d.*, c.* FROM dossier d, comptabilite c WHERE c.date_fin < NOW() AND c.date_fin > '1970-01-01' AND c.id_dossier = d.id";
	mysql_query ($requete);

}else {
	echo 'connexion impossible...'.mysql_error();
}

mysql_close($con);
?>